package test0927;

public class Demo1 {
    public static void main(String[] args) {
        //equals测试
        Person person1 = new Person("lll","nn",10);
        Person person2 = new Person("kkk","nn",10);
        Person person3 = new Person("lll","nn",10);
        //System.out.println(person1.toString());
        System.out.println(person1.equals(person2));
        //System.out.println(person1.equals(person3));

        Car car = new Car("red","123456");
        System.out.println(car.getColor());
        System.out.println(car.getNumber());
        System.out.println(car);
        Driver driver1 = new Driver("张三","男",15,car);
        Driver driver2 = new Driver(driver1);
        System.out.println(driver1);
        System.out.println(driver2);

        driver1.getCar().setColor("black");
        //System.out.println(driver1.getCar());
        System.out.println(driver1);
        System.out.println(driver2);



    }
}
